
var MyHashSet = function () {
    this.obj = {};
};

/** 
 * @param {number} key
 * @return {void}
 */
MyHashSet.prototype.add = function (key) {
    this.obj[key] = 1;
};

/** 
 * @param {number} key
 * @return {void}
 */
MyHashSet.prototype.remove = function (key) {
    if (this.obj[key]) {
        delete this.obj[key];
    }
};

/** 
 * @param {number} key
 * @return {boolean}
 */
MyHashSet.prototype.contains = function (key) {
    if (this.obj[key]) return "True";
    else return "False";
};

/** 
 * Your MyHashSet object will be instantiated and called as such:
 * var obj = new MyHashSet()
 * obj.add(key)
 * obj.remove(key)
 * var param_3 = obj.contains(key)
 */

// 测试数据
const myHashSet = new MyHashSet();
myHashSet.add(1);      // set = [1]
myHashSet.add(2);      // set = [1, 2]
console.log(myHashSet.contains(1)); // 返回 True
console.log(myHashSet.contains(3)); // 返回 False ，（未找到）
myHashSet.add(2);      // set = [1, 2]
console.log(myHashSet.contains(2)); // 返回 True
myHashSet.remove(2);   // set = [1]
// myHashSet.contains(2); // 返回 False ，（已移除）
console.log(myHashSet.contains(2)); // 返回 True
